HBASE-29947 Improve CopyTable usage instructions for copying between secure and non-secure clusters#7829
Conversation
There was a problem hiding this comment.
Pull request overview
Improves CopyTable’s CLI help/usage output by adding additional examples aimed at running CopyTable across secure/insecure clusters (including different Kerberos realms).
Changes:
- Add new
CopyTableusage examples showing how to set authentication/principal-related settings when copying across clusters with different security modes. - Include example commands for secure→insecure, cross-realm secure→secure, and insecure→secure scenarios.
Comments suppressed due to low confidence (4)
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java:260
- These new examples rely on
--peer.adrand-Dhbase.mapred.output.*overrides. Both are marked deprecated in the codebase (seeCopyTableusage text forpeer.adr, andTableOutputFormat.OUTPUT_CONF_PREFIXwhich is deprecated since 3.0.0 and slated for removal in 4.0.0). To keep the usage future-proof, please update the examples to use--peer.uriand pass any per-cluster overrides via the connection URI query parameters instead ofhbase.mapred.output.*.
System.err.println(
" To copy the data of 'TestTable' between the secured cluster and insecure cluster-b");
System.err.println(" $ hbase org.apache.hadoop.hbase.mapreduce.CopyTable "
+ "-Dhbase.mapred.output.hbase.security.authentication=simple "
+ "--peer.adr=cluster-b-1.example.com,cluster-b-2.example.com,cluster-b-3.example.com:"
+ "2181:/cluster-b" + " TestTable");
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java:257
- The example description is ambiguous about direction (“between the secured cluster and insecure cluster-b”), but CopyTable reads from the local cluster and writes to the configured peer. Consider rewording to explicitly state source vs destination (and use consistent terminology like “secure/secured” and “insecure”).
System.err.println(
" To copy the data of 'TestTable' between the secured cluster and insecure cluster-b");
System.err.println(" $ hbase org.apache.hadoop.hbase.mapreduce.CopyTable "
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java:265
- Wording/grammar in this example header is a bit hard to parse (“between different realm secured cluster”) and “kerberos” should be capitalized as “Kerberos” in user-facing help text. Please rephrase for clarity (e.g., “between secured clusters in different Kerberos realms”).
System.err.println(" To copy the data of 'TestTable' between different realm secured cluster.");
System.err.println(" Assume cluster-b uses different kerberos principal, "
+ "cluster-b/_HOST@EXAMPLE.COM, for master and regionserver kerberos principal from another "
+ "cluster");
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java:275
- Similarly here, “between the insecure cluster and secured cluster-b” doesn’t clarify which side is the local cluster vs the configured peer. Since the command always writes to the peer cluster, consider rewording to make the direction explicit.
System.err.println(
" To copy the data of 'TestTable' between the insecure cluster and secured cluster-b");
System.err.println(" $ hbase org.apache.hadoop.hbase.mapreduce.CopyTable "
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/CopyTable.java
Outdated
Show resolved
Hide resolved
5d708fb to
2313b0a
Compare
|
I took liberty to update jira/commit title to be more clear "Improve CopyTable usage instructions for copying between secure and non-secure clusters" FYI @srinireddy2020 and thank you for the fix. I will try to backport to other branches and will let you know in case they don't apply clean |
Improve CopyTable command usage to execute in secure clusters